// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './vuex/index.js'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VeeValidate, { Validator } from 'vee-validate'
import cn from 'vee-validate/dist/locale/zh_CN'
Validator.localize('zh_CN', cn)
Vue.use(VeeValidate)
Vue.use(Element)
Vue.config.productionTip = false
Vue.prototype.Url = '/api'
// router.beforeEach((to, from, next) => {
//   var info = localStorage.getItem('userInfo')
//   if (!info && to.name !== 'login') {
//     next({name: 'login'})
//   } else {
//     next()
//   }
// })
const dictionary = {
  cn: {
    messages: {
      is: () => '两次密码不一致'
    }
  }
}
Validator.localize('zh_CN', dictionary.cn)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
